package com.ni.learning.exam.vo;

import com.our.learning.infrastructure.po.Exam;
import com.our.learning.infrastructure.utils.DateUtils;

/**
 * @author : Ice'Clean
 * @date : 2023-06-23
 */
public class ExamVO {
    /** 考试 ID */
    private Integer id;
    /** 考试名称 */
    private String name;
    /** 试卷 ID */
    private Integer paperId;
    /** 试卷检查状态 */
    private Integer checked;
    /** 考试开始时间 */
    private String startTime;
    private Long startTimestamp;
    /** 考试结束时间 */
    private String endTime;
    private Long endTimestamp;

    public ExamVO(Exam exam) {
        this.id = exam.getId();
        this.name = exam.getName();
        this.paperId = exam.getPaperId();
        this.startTime = exam.getStartTime();
        this.startTimestamp = DateUtils.parseToTimestamp(startTime);
        this.endTime = exam.getEndTime();
        this.endTimestamp = DateUtils.parseToTimestamp(endTime);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPaperId() {
        return paperId;
    }

    public void setPaperId(Integer paperId) {
        this.paperId = paperId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public Long getStartTimestamp() {
        return startTimestamp;
    }

    public void setStartTimestamp(Long startTimestamp) {
        this.startTimestamp = startTimestamp;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Long getEndTimestamp() {
        return endTimestamp;
    }

    public void setEndTimestamp(Long endTimestamp) {
        this.endTimestamp = endTimestamp;
    }

    public Integer getChecked() {
        return checked;
    }

    public void setChecked(Integer checked) {
        this.checked = checked;
    }

    @Override
    public String toString() {
        return "ExamVO{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", paperId=" + paperId +
                ", checked=" + checked +
                ", startTime='" + startTime + '\'' +
                ", startTimestamp=" + startTimestamp +
                ", endTime='" + endTime + '\'' +
                ", endTimestamp=" + endTimestamp +
                '}';
    }
}
